package com.xy.biz.fd.domain.converter;

import com.xy.biz.fd.domain.bo.DocumentCodeRuleBO;
import com.xy.biz.fd.domain.po.DocumentCodeRulePO;
import com.xy.biz.fd.domain.resp.GetDocumentCodeRuleResponse;
import com.xy.biz.fd.domain.resp.GetDocumentCodeRuleResponse1;
import com.xy.tool.util.BeanUtilsEx;

import java.util.Collection;
import java.util.List;

/**
 *
 *
 * @author zsp
 * @date 2021-4-29
 */
public class DocumentCodeRuleConverter {

    public static DocumentCodeRulePO toPO(DocumentCodeRuleBO source) {
        return BeanUtilsEx.copyProperties(source, () -> new DocumentCodeRulePO(), true);
    }

    public static List<DocumentCodeRulePO> toPO(Collection<DocumentCodeRuleBO> source) {
        return BeanUtilsEx.copyPropertiesForNewList(source, () -> new DocumentCodeRulePO(), true);
    }

    public static DocumentCodeRuleBO fromPO(DocumentCodeRulePO source) {
        return BeanUtilsEx.copyProperties(source, () -> new DocumentCodeRuleBO());
    }

    public static List<DocumentCodeRuleBO> fromPO(Collection<DocumentCodeRulePO> source) {
        return BeanUtilsEx.copyPropertiesForNewList(source, () -> new DocumentCodeRuleBO());
    }

    //	public static DocumentCodeRuleBO toBO(SaveDocumentCodeRuleRequest source) {
//		return BeanUtilsEx.copyProperties(source, () -> new DocumentCodeRuleBO(), true);
//	}
//
//	public static List<DocumentCodeRuleBO> toBO(Collection<SaveDocumentCodeRuleRequest> source) {
//		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new DocumentCodeRuleBO(), true);
//	}
//
    public static GetDocumentCodeRuleResponse toResponse(DocumentCodeRuleBO source) {
        return BeanUtilsEx.copyProperties(source, () -> new GetDocumentCodeRuleResponse());
    }

    public static GetDocumentCodeRuleResponse1 toResponse1(DocumentCodeRuleBO source) {
        return BeanUtilsEx.copyProperties(source, () -> new GetDocumentCodeRuleResponse1());
    }

    public static GetDocumentCodeRuleResponse1 toResponse1(DocumentCodeRulePO source) {
        return BeanUtilsEx.copyProperties(source, () -> new GetDocumentCodeRuleResponse1());
    }

    public static List<GetDocumentCodeRuleResponse> toResponse(Collection<DocumentCodeRuleBO> source) {
        return BeanUtilsEx.copyPropertiesForNewList(source, () -> new GetDocumentCodeRuleResponse());
    }

}
